﻿<%@  Page Title="" Language="C#" MasterPageFile="~/Views/Shared/InternalPage.Master"
  Inherits="MvcContrib.FluentHtml.ModelViewPage<QuizResultsViewModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
  Quiz Results
</asp:Content>
<asp:Content ID="quizResultContent" ContentPlaceHolderID="PageHeader" runat="server">
  Quiz Results
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  <div class="quiz-results">
    <%: Model.QuizName %>
    - Given By
    <%: Model.Owner %>
    <table border="0" cellpadding="0" cellspacing="0">
      <thead>
        <tr>
          <th>
            Student
          </th>
          <th>
            #/Correct
          </th>
          <th>
            Percentage
          </th>
          <th>
            &nbsp;
          </th>
        </tr>
      </thead>
      <tbody>
        <% Model.Results.Each(m =>
                               {
        %>
        <tr>
          <td>
            <%: m.Student %>
          </td>
          <td>
            <%: m.CorrectAnswers %>&nbsp;/&nbsp;<%= m.NumberOfQuestions %>
          </td>
          <td><%: String.Format("{0:P0}", Math.Round((decimal)m.CorrectAnswers/(decimal)m.NumberOfQuestions, 2)) %></td>
          <td><%: Html.ActionLink("Details", "Answers", "Quiz", null, new { id = m.QuizResultId } ) %></td>
        </tr>
        <% }); %>
      </tbody>
    </table>
  </div>
</asp:Content>
<asp:Content ID="quizResultsScripts" ContentPlaceHolderID="Scripts" runat="server">
</asp:Content>
